<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('服务对话列列表')"/>
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="gray-bg">
<div class="container-div">


    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="formId">
                <div class="select-list">
                    <ul>

                        <li>
                            <label>开始时间：</label>
                            <input type="text" class="form-control"  th:value="${startTime}"  name="beginTime" id="beginTime"
                                   placeholder="呼叫开始时间" />
                        </li>
                        <li>
                            <label>开始结束：</label>
                            <input type="text" class="form-control"  th:value="${endTime}" name="endTime" id="endTime"
                                   placeholder="呼叫结束时间" />
                        </li>
                        <li>
                            <label>坐席号码：</label>
                            <input type="text"  th:value="${agentid}"  name="agentid"/>
                        </li>


                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" style="margin-right:10px" onclick="$.table.search()"><i
                                    class="fa fa-search" ></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i
                                    class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>


        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div><th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>

<script th:inline="javascript">
    var editFlag = [[${@permission.hasPermi('system:service:edit')}]];
    var removeFlag = [[${@permission.hasPermi('system:service:remove')}]];
    var prefix = ctx + "system/service";

    $(function () {
        var options = {
            url: prefix + "/listTelNomanyiYiban",
            createUrl: prefix + "/add",
            updateUrl: prefix + "/edit/{id}",
            removeUrl: prefix + "/remove",
            exportUrl: prefix + "/export",
            modalName: "服务对话列",
            columns: [{
                checkbox: true
            },
                {
                    field: 'serviceId',
                    title: '通话会话Id',
                    visible: false
                },
                {
                    field: 'beginTime',
                    title: '呼叫发起时间'
                },
                {
                    field: 'endTime',
                    title: '呼叫挂断时间'

                },
                {
                    field: 'fromnum',
                    title: '客户电话'

                },
                {
                    field: 'agentid',
                    title: '服务坐席'

                },
                {
                    field: 'satisfaction',
                    title: '满意度',
                    formatter: function (value, row, index) {
                        if (row.satisfaction == "2"){
                            return '满意'
                        }
                        if (row.satisfaction == "3"){
                            return '一般'
                        }
                        if (row.satisfaction == "5"){
                            return '不满意'
                        }
                        return  "未评价";
                    }

                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function (value, row, index) {
                        var actions = [];
                        actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.serviceId + '\')"><i class="fa fa-edit"></i>通话详情</a> ');

                        return actions.join('');
                    }


                }]
        };
        $.table.init(options);
    });
</script>
<style>
    .select-list li{
        display: flex;
    }
</style>
</body>
</html>